Proper connect_port
[juce-lv2.git] / juce / source / extras / the jucer / src / ui / jucer_ComponentOverlayComponent.h
blob5938d8f8cc33d4ee52734f7cd686348c9fd0c48c
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCER_COMPONENTOVERLAYCOMPONENT_JUCEHEADER__
27 #define __JUCER_COMPONENTOVERLAYCOMPONENT_JUCEHEADER__
29 #include "../model/jucer_JucerDocument.h"
32 //==============================================================================
33 /**
35 class ComponentOverlayComponent : public Component,
36 public ComponentListener,
37 public ChangeListener,
38 public ComponentBoundsConstrainer
40 public:
41 //==============================================================================
42 ComponentOverlayComponent (Component* const targetComponent,
43 ComponentLayout& layout);
45 ~ComponentOverlayComponent();
47 //==============================================================================
48 virtual void showPopupMenu();
50 //==============================================================================
51 void paint (Graphics& g);
52 void resized();
54 void mouseDown (const MouseEvent& e);
55 void mouseDrag (const MouseEvent& e);
56 void mouseUp (const MouseEvent& e);
58 void componentMovedOrResized (Component& component, bool wasMoved, bool wasResized);
60 void changeListenerCallback (ChangeBroadcaster*);
62 void resizeStart();
63 void resizeEnd();
65 void updateBoundsToMatchTarget();
67 void checkBounds (Rectangle<int>& bounds,
68 const Rectangle<int>& previousBounds,
69 const Rectangle<int>& limits,
70 bool isStretchingTop,
71 bool isStretchingLeft,
72 bool isStretchingBottom,
73 bool isStretchingRight);
75 void applyBoundsToComponent (Component* component, const Rectangle<int>& bounds);
77 //==============================================================================
78 Component::SafePointer<Component> target;
79 const int borderThickness;
81 private:
82 ResizableBorderComponent* border;
84 ComponentLayout& layout;
86 bool selected, dragging, mouseDownSelectStatus;
87 double originalAspectRatio;
92 #endif // __JUCER_COMPONENTOVERLAYCOMPONENT_JUCEHEADER__